package xyz.heyaoshare.core.controller.system.menu.vo.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import xyz.heyaoshare.core.enums.system.menu.MenuOpenStyleEnum;
import xyz.heyaoshare.core.enums.system.menu.MenuStatusEnum;
import xyz.heyaoshare.core.enums.system.menu.MenuTypeEnum;
import xyz.heyaoshare.utils.DateUtils;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 菜单树响应对象
 * @author YueHe
 * @version 0.0.1
 * @since 2025/5/9 下午4:37
 */
@Data
@Schema(description = "菜单树结构")
public class MenuTreeRespVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "菜单ID")
    private Long id;

    @Schema(description = "父菜单ID")
    private Long parentId;

    @Schema(description = "菜单名称")
    private String name;

    @Schema(description = "菜单URL")
    private String url;

    @Schema(description = "授权标识【多个用英文逗号分隔】")
    private String authority;

    /**
     * @see MenuTypeEnum#getValue()
     */
    @Schema(description = "菜单类型")
    private Integer type;

    @Schema(description = "菜单类型描述")
    private String typeStr;

    /**
     * @see MenuOpenStyleEnum#getValue()
     */
    @Schema(description = "打开方式")
    private Integer openStyle;

    @Schema(description = "打开方式描述")
    private String openStyleStr;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "菜单排序")
    private Integer sort;

    /**
     * @see MenuStatusEnum#getValue()
     */
    @Schema(description = "菜单状态")
    private Integer status;

    @Schema(description = "菜单状态描述")
    private String statusStr;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = DateUtils.YYYY_MM_DD_HH_MM_SS, timezone = DateUtils.TIME_ZONE)
    private LocalDateTime createTime;

    @Schema(description = "子菜单列表")
    private List<MenuTreeRespVO> children;

}